home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 120
/
Vol 120.iso
/
games
/
fratboy_.swf
/
scripts
/
DefineSprite_2047
/
frame_1
/
DoAction.as
Wrap
Text File
|
2010-11-09
|
2KB
|
92 lines
function blockMove()
{
if(_root.pausee != true)
{
if(_root.delay != undefined)
{
if(_root.delay != this.d)
{
this.counter = 0;
}
if(_root.delay != undefined)
{
this.counter = this.counter + 1;
}
if(this.counter == _root.delay)
{
this.counter = 0;
this._x -= 0.5;
}
this.d = _root.delay;
}
if(this._x <= 0 && this.proshla != true)
{
this.proshla = true;
_root.creatureType = this.type;
_root.creatureGen(16);
_root.delay = 7;
}
if(this._x < -100)
{
this.swapDepths(99999);
this.removeMovieClip();
}
}
}
function generate(xx)
{
a[0] = random(4) + 1;
a[1] = random(4) + 1;
while(a[1] == a[0])
{
a[1] = random(4) + 1;
}
a[2] = random(4) + 1;
while(a[2] == a[0] || a[2] == a[1])
{
a[2] = random(4) + 1;
}
a[3] = random(4) + 1;
while(a[3] == a[0] || a[3] == a[1] || a[3] == a[2])
{
a[3] = random(4) + 1;
}
i = 0;
while(i < 4)
{
this.attachMovie("crType" + a[i],"crType" + _root.creatureGroupNum + i,this.getNextHighestDepth(),{_x:xx + 91.5 * i,_y:-4});
eval("crType" + _root.creatureGroupNum + i).onEnterFrame = blockMove;
eval("crType" + _root.creatureGroupNum + i).type = a[i];
eval("crType" + _root.creatureGroupNum + i).counter = 0;
i++;
}
}
var a = new Array();
counter = 0;
a[4] = 1;
a[5] = 2;
a[6] = 3;
a[7] = 4;
i = 4;
while(i < 8)
{
this.attachMovie("crType" + a[i],"crType" + i,this.getNextHighestDepth(),{_x:0.1 + 91.5 * (i - 4),_y:-4});
eval("crType" + i).onEnterFrame = blockMove;
eval("crType" + i).type = a[i];
eval("crType" + i).counter = 0;
i++;
}
generate(366);
this.onEnterFrame = function()
{
if(eval("crType" + _root.creatureGroupNum + 0)._x < 0)
{
_root.creatureGroupNum = _root.creatureGroupNum + 1;
a[4] = a[0];
a[5] = a[1];
a[6] = a[2];
a[7] = a[3];
generate(366);
}
};